﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Security;

namespace Rsa.Security {
    public class RsaRoleProvider : RoleProvider {
        #region "Public Methods"
        // HACK: Eliminar valores quemados y hacer algo generico
        public override string[] GetAllRoles() {
            // Ya que solo tendremos un rol de usuario
            // solo devolvere el rol "usuario"
            return new string[] {"usuario"};
        }
        public override bool IsUserInRole(string username, string roleName) {
            //if(roleName.ToLower().Equals("usuario"))
            //    return true;
            //return false;
            return true;
        }
        public override string[] GetRolesForUser(string username) {
            return new string[] { "usuario" };
        }
        #endregion

        #region "Non-implemented"
        public override string ApplicationName {
            get {
                throw new NotImplementedException();
            }
            set {
                throw new NotImplementedException();
            }
        }
        public override string Description {
            get {
                return base.Description;
            }
        }
        public override string Name {
            get {
                return base.Name;
            }
        }

        public override void AddUsersToRoles(string[] usernames, string[] roleNames) {
            throw new NotImplementedException();
        }
        public override void CreateRole(string roleName) {
            throw new NotImplementedException();
        }
        public override bool DeleteRole(string roleName, bool throwOnPopulatedRole) {
            throw new NotImplementedException();
        }
        public override string[] FindUsersInRole(string roleName, string usernameToMatch) {
            throw new NotImplementedException();
        }
        public override string[] GetUsersInRole(string roleName) {
            throw new NotImplementedException();
        }
        public override void RemoveUsersFromRoles(string[] usernames, string[] roleNames) {
            throw new NotImplementedException();
        }
        public override bool RoleExists(string roleName) {
            throw new NotImplementedException();
        }
        #endregion
    }
}